<div class="page-content">
    <!-- BEGIN PAGE HEADER-->
	<div class="row">
		<div class="col-md-12">
			<!-- BEGIN PAGE TITLE & BREADCRUMB-->
			<h3 class="page-title">
		          Add Article
			</h3>
			<ul class="page-breadcrumb breadcrumb">
				<li>
					<i class="fa fa-home"></i>
					<a href="<?php echo $this->Admin->admin_url() ?>">
						Home
					</a>
					<i class="fa fa-angle-right"></i>
				</li>
				<li>
					<a href="<?php echo $this->Admin->admin_url() ?>users/index">
						User list
					</a>
					<i class="fa fa-angle-right"></i>
				</li>
				<li>
					<a href="javascript:void(0)">
						Edit User
					</a>
				</li>
			</ul>
			<!-- END PAGE TITLE & BREADCRUMB-->
		</div>
	</div>
	<!-- END PAGE HEADER-->
	<!-- BEGIN PAGE CONTENT-->
    <div class="row">
        <div class="col-md-12">
        	<!-- BEGIN VALIDATION STATES-->
        	<div class="portlet box blue">
        		<div class="portlet-title">
        			<div class="caption">
        				<i class="fa fa-reorder"></i>Managed_table
        			</div>
        		</div>
        		<div class="portlet-body form">
        			<!-- BEGIN FORM-->
        			<!--form action="" id="form_category" class="form-horizontal" method="post"-->
                    <?php
                        echo $this->Form->create('User', array(
                                                            'url' => array('controller' => 'users', 'action' => 'edit', $user_id), 
                                                            'type' => 'post',
                                                            'id' => 'form_user',
                                                            'class' => 'form-horizontal'));
                    ?>
        				<div class="form-body">
                            <div class="form-group">
        						<label class="control-label col-md-3">Tên đăng nhập
        						</label>
        						<div class="col-md-9">
        							<?php
                                        echo $this->Form->input('username',
                                                        array(
                                                            'label' => false,
                                                            'div' => false,
                                                            'class' => 'form-control',
                                                            'value' => $user_info['username'],
                                                        )
                                        );
                                        echo $this->Form->input('user_id',
                                                        array(
                                                            'label' => false,
                                                            'div' => false,
                                                            'type' => 'hidden',
                                                            'value' => $user_id
                                                        )
                                        );
                                        
                                    ?>
        						</div>
        					</div>
                            
                            <div class="form-group">
        						<label class="control-label col-md-3">Họ tên
        						</label>
        						<div class="col-md-9">
        							<?php
                                        echo $this->Form->input('name',
                                                        array(
                                                            'label' => false,
                                                            'div' => false,
                                                            'class' => 'form-control',
                                                            'value' => $user_info['name'],
                                                        )
                                        );
                                    ?>
        						</div>
        					</div>
                            
                            <div class="form-group">
        						<label class="control-label col-md-3">Email
        						</label>
        						<div class="col-md-9">
        							<?php
                                        echo $this->Form->input('email',
                                                        array(
                                                            'label' => false,
                                                            'div' => false,
                                                            'class' => 'form-control',
                                                            'value' => $user_info['email'],
                                                        )
                                        );
                                    ?>
        						</div>
        					</div>
                            
                            <div class="form-group">
        						<label class="control-label col-md-3">Ngày sinh
        						</label>
        						<div class="col-md-9">
        							<?php
                                        echo $this->Form->input('date_birth', 
                                            array(
                                                'type' => 'date',
                                                'label' => false,
                                                'div' => false,
                                                'dateFormat' => 'MDY',
                                                'empty' => array(
                                                    'month' => 'Month',
                                                    'day'   => 'Day',
                                                    'year'  => 'Year'
                                                ),
                                                'minYear' => date('Y')-130,
                                                'maxYear' => date('Y'),
                                                'options' => array('1','2'),
                                                'class' => 'form-control date_birth',
                                                'selected' => $user_info['date_birth']
                                            )
                                        );
                                    ?>
        						</div>
        					</div>
                            <?php 
                                echo $this->Form->input('phone',
                                                        array(
                                                            'label' => array('class' => 'control-label col-md-3', 'text' => 'Số điện thoại'),
                                                            'div' => array('class' => 'form-group'),
                                                            'between' => '<div class="col-md-9">',
                                                            'after' => '</div>',
                                                            'class' => 'form-control',
                                                            'value' => $user_info['phone'],
                                                        )
                                );

                            ?>
                            <div class="form-group">
        						<label class="control-label col-md-3">Giới tính
        						</label>
        						<div class="col-md-2">
        							<?php
                                        $options = array('1' => 'Nam', '0' => 'Nữ');
                                        //$selected = array($user_info['gender']);
                                        echo $this->Form->select('gender', $options,  
                                                                array(
                                                                    'class' => 'form-control',
                                                                    'default' => $user_info['gender'],
                                                                )
                                        );
                                        

                                    ?>
        						</div>
        					</div>
                            <div class="form-group">
        						<label class="control-label col-md-3">Địa chỉ
        						</label>
        						<div class="col-md-9">
        							<?php
                                        echo $this->Form->textarea('address', array('class' => 'form-control', 'value' => $user_info['address'],));
                                    ?>
        						</div>
        					</div>
        				</div>
        				<div class="form-actions fluid">
        					<div class="col-md-offset-3 col-md-9">
                                <button type="submit" class="btn blue" name="btn_submit" value="ok">Submit</button>
        						<button type="button" class="btn default" onclick="window.location.href='<?php echo $this->Admin->admin_url() ?>users/index'">Cancel</button>
        					</div>
        				</div>
                        
        			<?php echo $this->Form->end(); ?>
        			<!-- END FORM-->
        		</div>
        		<!-- END VALIDATION STATES-->
        	</div>
        </div>
    </div>
</div>                     
<!-- END CONTENT -->

